home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #4 / utv2n4s2.d64 / vision times ii (.txt) < prev   
Commodore BASIC  |  2022-08-28  |  10KB  |  393 lines

  1. 2 clr
  2. 4 rem data 32,155,183,138,72,32,155,183,104,170,164,101,24,76,240,255
  3. 6 bc=198:if fre(1)<>fre(0) then bc=208
  4. 7 rem sa=32768
  5. 8 rem for j=sa to sa+15:read x:poke j,x:next j
  6. 10 poke53280,0:poke53281,0
  7. 12 xr=781:yr=782:pr=783
  8. 14 if bc>200 then xr=7:yr=8:pr=5
  9. 16 er$="                          "
  10. 20 dims(11),s$(11),se$(11),s1(20)
  11. 100 gosub4000
  12. 105 gosub 10000
  13. 107 gosub 21000
  14. 108 gosub 7500
  15. 110 gosub3600
  16. 120 h=0:v=10:tx$="[196]o you need a lesson? "
  17. 130 gosub3200
  18. 135 gosub 7600
  19. 140 lo=0:gosub2100
  20. 150 ifa$="y"ora$="[217]"thengosub20000:goto 160
  21. 151 if a$="n" or a$="[206]" then 160
  22. 152 goto 120
  23. 160 gosub5000
  24. 165 ru=1
  25. 170 gosub1000
  26. 172 ifop<>3then180
  27. 174 gosub3600
  28. 176 gosub500
  29. 180 gosub3600
  30. 190 v=10:tx$="[196]o you want to play again? ([217]/[206]) "
  31. 200 gosub3000:gosub 3200:gosub 7600
  32. 210 lo=0:gosub2100:printa$
  33. 220 ifa$="y"ora$="[217]"thenprinttab(23)"[145]              ":goto 160
  34. 221 if a$="n" or a$="[206]" then 230
  35. 222 goto 190
  36. 230 sys 8*4096+4
  37. 500 v=10:h=0:tx$="[217]ou got"+str$(np-mi)+" right out of"+str$(np) +" problems"
  38. 510 gosub3200
  39. 540 v=12:tx$="for"+str$(int(((np-mi)/np)*100))+"%."
  40. 545 gosub3200:gosub 7600
  41. 550 delay=5:gosub2000
  42. 560 return
  43. 1000 rem *** central routine ***
  44. 1005 hp=0:mi=0
  45. 1010 fori=1tonp
  46. 1020 gosub19000
  47. 1025 gosub 7500:gosub3600
  48. 1030 h=0:v=6:tx$="[198]ind the "+md$+":"
  49. 1035 gosub3200:gosub 7600:if md<>1 then 1065
  50. 1040 gosub 7000
  51. 1050 goto 1066
  52. 1065 onopgosub11000,11000,17000
  53. 1066 v=24:tx$="   <[210][197][212][213][210][206]> to [195]ontinue, <[198]8> to [197]xit [146]"
  54. 1067 gosub3000:gosub3200
  55. 1068 lo=0:gosub2100
  56. 1069 if a$<>"[140]" and a$<>chr$(13) then 1068
  57. 1070 ifa$="[140]"then sa=i:i=np
  58. 1074 nexti:if sa<>0 thennp=sa
  59. 1075 gosub7500:return
  60. 2000 rem *** timer ***
  61. 2010 ti$="000000"
  62. 2015 geta$:ifa$<>""then2030
  63. 2020 ifti/60<delaythen2015
  64. 2030 return
  65. 2100 rem *** get character ***
  66. 2110 poke bc,0
  67. 2115 geta$:ifa$=""then2115
  68. 2117 if a$="[140]" then gosub 7500:goto 180
  69. 2120 a=val(a$):ifa<loora>hithen2115
  70. 2130 return
  71. 3000 rem *** center text ***
  72. 3010 x1=len(tx$)
  73. 3020 h=(40-x1)/2
  74. 3030 return
  75. 3100 v=24:tx$="    <[210][197][212][213][210][206]> to [195]ontinue [146]"
  76. 3110 gosub3000:gosub3200:gosub 7600
  77. 3120 lo=0:gosub2100
  78. 3130 ifa$<>chr$(13) then 3100
  79. 3140 return
  80. 3200 if h<0 then h=0
  81. 3210 poke xr,v:poke yr,h:poke pr,0:sys 65520:print tx$;:return
  82. 3500 rem *** line across screen ***
  83. 3510 print"";
  84. 3520 forq=1to20
  85. 3530 print"[178][178]";
  86. 3540 next
  87. 3550 forq=1to20
  88. 3560 print"[177][177]";
  89. 3570 next
  90. 3575 print"";
  91. 3580 return
  92. 3600 rem *** print screen header ***
  93. 3610 print"[147]"
  94. 3630 tx$="[214][201][211][201][207][206] [211][207][198][212][215][193][210][197] and"
  95. 3640 h=10:v=0:gosub 3200
  96. 3650 tx$="[213]p[212]ime [205]agazine [208]resents:":h=10:v=1:gosub 3200
  97. 3660 tx$=t$
  98. 3665 print"";
  99. 3670 h=10
  100. 3680 v=3:gosub3200
  101. 3685 print"";
  102. 3690 print:gosub3500:return
  103. 4000 rem *** read data ***
  104. 4005 readt$
  105. 4010 fori=1to6
  106. 4020 readrw$(i)
  107. 4030 nexti
  108. 4040 fori=1to3
  109. 4050 readop$(i)
  110. 4060 nexti
  111. 4070 fori=1to4
  112. 4080 readmu$(i),co(i)
  113. 4090 next:return
  114. 4100 rem *** program data ***
  115. 4110 data"[214]ision [212]imes [201][201]"
  116. 4120 data"[199]reat!","[198]antastic!","[211]uper!"
  117. 4130 data"[217]ou're really going now!","[217]es!  [217]es!  [217]es!","[212]hat's great!"
  118. 4140 data"[211]ee examples done."
  119. 4150 data"[196]o problems with help."
  120. 4160 data"[196]o problems yourself."
  121. 4170 data"units",28,"tens",30,"hundreds",31,"thousands",158
  122. 5000 rem *** setup for math ***
  123. 5001 ifru=1then5037
  124. 5010 h=0:v=10:tx$="[215]hat's your first name "
  125. 5020 gosub3200
  126. 5030 mx=16:gosub 11000:na$=te$
  127. 5035 if na$="" then na$="[195]omputer [215]iz"
  128. 5036 ifleft$(na$,1)<"z"thenna$=chr$(asc(left$(na$,1))+128)+right$(na$,len(na$)-1)
  129. 5037 v=10:h=0:tx$="[215]ould you like to:                     "
  130. 5038 gosub3200
  131. 5040 h=7:v=12:fori=1to3
  132. 5050 tx$=str$(i)+". "+op$(i)
  133. 5060 gosub3200
  134. 5070 v=v+2
  135. 5080 nexti
  136. 5090 h=0:tx$="[217]our choice? (1-3) "
  137. 5100 gosub3200
  138. 5110 lo=1:hi=3:gosub2100:printa$
  139. 5120 op=a:hi=10
  140. 5130 ifop=1thenhi=5
  141. 5140 gosub 7500:gosub 3600
  142. 5150 v=10:h=0:tx$="[200]ow many problems do you want"
  143. 5160 gosub3200
  144. 5170 v=11:tx$="to do? (2 -"+str$(hi)+")   [157][157]"
  145. 5180 h=5:gosub3200:gosub 7600
  146. 5190 mx=2:gosub 11000:np=val(te$)
  147. 5200 ifnp<2 ornp>hithen np=0:goto5170
  148. 5210 v=13:tx$="[215]e will use 2 digit and 4 digit":h=0:gosub 3200
  149. 5220 v=14:h=5:tx$="numbers, "+na$+".":gosub 3200
  150. 5260 n1=4
  151. 5310 n2=2
  152. 5390 return
  153. 7000 rem option 1 - multiply
  154. 7010 v=9:h=38-len(se$(1)):tx$=se$(1):gosub 3200
  155. 7020 v=10:h=38-len(se$(2)):tx$=se$(2):gosub 3200
  156. 7025 v=11:h=37-len(se$(1)):tx$="[192][192][192][192][192][192][192][192]":if n1=3 then tx$=left$(tx$,8)
  157. 7030 gosub 3200 : if op=3 then 9000
  158. 7040 vv=0:for ii=3 to 1 step -2 :v=12+vv:h=0
  159. 7043 mu=val(mid$(se$(2),ii,1)): jk=1
  160. 7045 v=12+vv:h=0:tx$="[205]ultiply"+s$(1)+"by"+str$(mu*(10^vv))+".":gosub 3200
  161. 7046 delay=3:gosub 2000
  162. 7047 for jj=n(1)to 1 step-1 : v=18:h=0:tx$=er$:gosub 3200:v=16:gosub 3200
  163. 7048 v=20:gosub 3200
  164. 7049 v=16:h=0:tx$="[205]ultiply the "+mu$(jk)+"."
  165. 7050 gosub 3200:if op=1 then delay=1:gosub 2000
  166. 7054 v=18:h=0:tx$=str$(mu)+" x"+str$(d(jj)):if ca<>0 then tx$=tx$+" +"+ca$
  167. 7055 an=mu*d(jj)+ca:ca=int(an/10) :ca$=str$(ca):an$=str$(an)
  168. 7056 v=18:h=0:tx$=tx$+" = ":if op=1 then tx$=tx$+an$
  169. 7058 gosub 3200:if op=1 thengosub 2000
  170. 7060 vj=12+vv:hj=36-(vv*2)-(jk*2):if ca=0 then hj=hj+1
  171. 7061 if op=1 then 7080
  172. 7065 mx=3:gosub 11000:tt=val(te$)
  173. 7070 if tt=an then gosub 8000
  174. 7080 h=hj:hh=h:tx$=an$:v=vj
  175. 7090 gosub 3200:delay=.3:gosub 2000
  176. 7091 if ca=0 then 7150
  177. 7095 tx$="[195]arry the"+ca$+".":v=20:h=0:gosub 3200
  178. 7100 tx$=""+ca$:v=8:h=hh-1+(vv*2):gosub 3200
  179. 7110 tx$="  ":v=12+vv:h=hh:gosub 3200
  180. 7150 jk=jk+1:delay=3: gosub 2000
  181. 7155 next jj:if ca<>0 thenv=12+vv:h=hh-1:tx$=ca$:gosub 3200
  182. 7160 vv=vv+1:tx$=er$:v=8:h=10:gosub 3200:ca=0:gosub 3100:v=24:tx$=er$
  183. 7165 gosub 3000:   gosub 3200:next ii
  184. 7170 v=12+vv:h=hh-1:tx$="[192][192][192][192][192][192][192][192][192][192][192]"
  185. 7175 if n1>=4 then tx$=tx$+"[192]"
  186. 7180 gosub 3200 :for v=16 to 20 step 2:h=0:tx$=er$:gosub 3200:next v
  187. 7185 v=16:tx$="[206]ow add:":gosub 3200 :if op=1 then 7210
  188. 7190 if op=2 then s$=se$(7):gosub 14000:goto 7240
  189. 7210 v=16:hh=36 :for jj=len(se$(7))-1 to 1 step-2:h=hh:tx$=mid$(se$(7),jj,1)
  190. 7220 gosub 3200:delay=2:gosub 2000:hh=hh-2
  191. 7230 next jj
  192. 7240 return
  193. 7500 poke 53265,11
  194. 7510 rem poke 53296,255
  195. 7520 return
  196. 7600 rem poke 53296,0
  197. 7610 poke 53265,27
  198. 7620 return
  199. 8000 rw=int(rnd(0)*6)+1
  200. 8010 forj=1to2
  201. 8020 v=20:h=5 :tx$=chr$(co(j))+rw$(rw)
  202. 8030 gosub3200
  203. 8040 delay=.3:gosub2000
  204. 8050 tx$=chr$(5)+er$:gosub3200
  205. 8060 delay=.1:gosub2000
  206. 8070 nextj :return
  207. 9000 v=15:h=0 :tx$="[217]our answer: "
  208. 9010 gosub3200
  209. 9020 mx=5:gosub 11000:an=val(te$)
  210. 9030 ifint(an)=int(s(7))then9080
  211. 9040 mi=mi+1
  212. 9050 v=17:tx$="[212]he correct answer is "+s$(7)+"." :h=0
  213. 9060 gosub3200
  214. 9070 goto 9180
  215. 9080 rw=int(rnd(0)*6)+1
  216. 9090 forj=1to5
  217. 9100 v=20:tx$=chr$(co(j))+rw$(rw)
  218. 9110 gosub3000:gosub3200
  219. 9120 delay=.7:gosub2000
  220. 9130 tx$=er$
  221. 9140 gosub3000:gosub3200
  222. 9150 delay=.3:gosub2000
  223. 9160 nextj
  224. 9180 return
  225. 10000 rem *** do spritey things ***
  226. 10010 sa=704:if bc>200 then sa=2816
  227. 10020 for i=sa to sa+63
  228. 10030 readx:pokei,x
  229. 10040 next
  230. 10050 poke2040,11:if bc>200 then poke 2040,44
  231. 10060 poke53287,2:poke53277,255:poke53271,255
  232. 10070 poke53248,30:poke53249,58
  233. 10075 if bc>200 then (NULL) 1,30,58
  234. 10080 return
  235. 10090 data252,252,252,121,249,248,51,243,240
  236. 10100 data7,231,224,15,207,192,7,159,128
  237. 10110 data3,63,0,0,126,0,0,252,0
  238. 10120 data0,120,0,0,48,0,0,0,0
  239. 10130 data0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  240. 11000 te$="":print"[164]";
  241. 11010 get a$:if a$="" then 11010
  242. 11020 if a$=chr$(13) then printchr$(20):return
  243. 11030 if a$=chr$(20) and te$="" then 11010
  244. 11040 if a$=chr$(20) then te$=left$(te$,len(te$)-1):printa$a$"[164]";:goto 11010
  245. 11045 if a$="[140]" then gosub 7500:goto 180
  246. 11050 if a$<" " or a$>"[218]" then 11010
  247. 11060 if a$>"z" and a$<"[193]" then 11010
  248. 11070 if len(te$)=mx then 11010
  249. 11080 printchr$(20)a$"[164]";
  250. 11090 te$=te$+a$:goto 11010
  251. 14000 rem *** examples with help ***
  252. 14010 v1=16:h1=36:s$=se$(7)
  253. 14020 forj=len(s$)-1 to1step-2
  254. 14030 v=v1+1:h=h1:tx$="^":gosub 3200
  255. 14050 y=0:lo=0:hi=9
  256. 14060 gosub2100
  257. 14070 ifa$=mid$(s$,j,1)then14150
  258. 14080 y=y+1:ify<3then14060
  259. 14090 v=23:tx$="[197]nter a "+mid$(s$,j,